// pages/toplist/toplist.js
import { Base } from '../../utils/base.js'

import { Home } from 'toplist-model.js'
var home = new Home();

Page({

  /**
   * 页面的初始数据
   */
  data: {

  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    this._getData()
  },
  _getData(){
    var id=2;
    var data = home.getTopList(id,(res)=>{
      console.log(res)
      this.setData({
        "topList": res.data.topList
      });
    })
  },
 
  toList(event){
    console.log(event.currentTarget.dataset.id)
    var id = event.currentTarget.dataset.id;
    wx.navigateTo({
      url: 'topListInfo/topListInfo?id='+id,
    })
  }
 
})